package com.lcredu.spring;

import com.lcredu.spring.component.MonsterDao;
import com.lcredu.spring.component.MonsterService;
import com.lcredu.spring.component.SmartAnimal;
import com.lcredu.spring.component.SmartDog;
import com.lcredu.spring.ioc.LcrSpringApplicationContext;
import com.lcredu.spring.ioc.LcrSpringConfig;

/**
 * @author 黎长容
 * @date 2025-07-16 15:27
 */
public class AppMain {
    public static void main(String[] args) {
        LcrSpringApplicationContext ioc = new LcrSpringApplicationContext(LcrSpringConfig.class);

//        MonsterService monsterService
//                = (MonsterService)ioc.getBean("monsterService");
//        monsterService.sayHi();


//        MonsterService monsterService1 = (MonsterService)ioc.getBean("monsterService");
//        MonsterService monsterService2 = (MonsterService) ioc.getBean("monsterService");
//        System.out.println("monsterService1="+monsterService1);
//        System.out.println("monsterService2="+monsterService2);
//        MonsterDao monsterDao1 = (MonsterDao)ioc.getBean("monsterDao");
//        MonsterDao monsterDao2 = (MonsterDao) ioc.getBean("monsterDao");
//        System.out.println("monsterDao1="+monsterDao1);
//        System.out.println("monsterDao2="+monsterDao2);

        SmartAnimal smartDog = (SmartAnimal) ioc.getBean("smartDog");
//        SmartDog object = (SmartDog )ioc.getBean("smartDog");
        smartDog.getSum(10,3);
        smartDog.getSub(10,3);
        System.out.println("ok...");
    }
}
